package gui.layer;

import java.io.IOException;

import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.TiledLayer;

/**
 * Base class for the layers of the game field.
 * @author Sandra Mayer
 *
 */
public class BaseLayer extends TiledLayer {
	
	//	 the game boundary
	public static final int GAME_WIDTH = 240;
	public static final int GAME_HEIGHT = 300;

	//	 the shifted x,y origin of the game
	public final int GAME_ORIGIN_X = 0; 
	public final int GAME_ORIGIN_Y = 0;
	
	public static final int NROFCELLSHOR = 5;
	public static final int NROFCELLSVER = 5;
	public static final int SIZEOFCELL = 48;

	/**
	 * Constructor.
	 * @param arg0 the number of cells vertical
	 * @param arg1 the number of cells horizontal
	 * @param arg2 The background image
	 * @param arg3 the size of one cell
	 * @param arg4 the size of one cell
	 */
	public BaseLayer(int arg0, int arg1, Image arg2, int arg3, int arg4) {
		super(arg0, arg1, arg2, arg3, arg4);
	}
	
	/**
	 * Constructor that gets a string instead of an image and creates the image.
	 * @param arg0 the number of cells vertical
	 * @param arg1 the number of cells horizontal
	 * @param arg2 the String for the background image
	 * @param arg3 the size of one cell
	 * @param arg4 the size of one cell
	 * @throws IOException IOException
	 */
	public BaseLayer(int arg0, int arg1, String arg2, int arg3, int arg4) throws IOException {
		super(arg0, arg1, Image.createImage(arg2), arg3, arg4);
	}
	
	/**
	 * Constructor, that gets the field and the filename of the picture.
	 * @param field the field
	 * @param filename the filename of the background image
	 * @throws IOException IOException
	 */
	public BaseLayer(int[] field, String filename) throws IOException {
		super(NROFCELLSHOR, NROFCELLSVER, Image.createImage(filename), SIZEOFCELL, SIZEOFCELL);
	}
}
